/*
package com.example.PersonalAddressBook2;


import com.example.PersonalAddressBook.Contact;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        DataAccess dataAccess = new DataAccess();
        BusinessLogic businessLogic = new BusinessLogic(dataAccess);

        try {
            while (true) {
                System.out.println("1. Add Contact\n2. Update Contact\n3. Delete Contact\n4. List Contacts\n5. Exit");
                int choice = Integer.parseInt(scanner.nextLine());
                switch (choice) {
                    case 1:
                        addContact(businessLogic, scanner);
                        break;
                    case 2:
                        updateContact(businessLogic, scanner);
                        break;
                    case 3:
                        deleteContact(businessLogic, scanner);
                        break;
                    case 4:
                        listContacts(businessLogic);
                        break;
                    case 5:
                        return;
                    default:
                        System.out.println("Invalid choice!");
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }

    private static void addContact(BusinessLogic logic, Scanner scanner) throws SQLException {
        System.out.print("Enter Name: ");
        String name = scanner.nextLine();
        System.out.print("Enter Address: ");
        String address = scanner.nextLine();
        System.out.print("Enter Phone: ");
        String phone = scanner.nextLine();
        Contact contact = new Contact(0, name, address, phone);
        logic.addContact(contact);
    }

    private static void updateContact(BusinessLogic logic, Scanner scanner) throws SQLException {
        System.out.print("Enter ID to update: ");
        int id = Integer.parseInt(scanner.nextLine());
        System.out.print("Enter New Name: ");
        String name = scanner.nextLine();
        System.out.print("Enter New Address: ");
        String address = scanner.nextLine();
        System.out.print("Enter New Phone: ");
        String phone = scanner.nextLine();
        Contact contact = new Contact(id, name, address, phone);
        logic.updateContact(contact);
    }

    private static void deleteContact(BusinessLogic logic, Scanner scanner) throws SQLException {
        System.out.print("Enter ID to delete: ");
        int id = Integer.parseInt(scanner.nextLine());
        logic.deleteContact(id);
    }

    private static void listContacts(BusinessLogic logic) throws SQLException {
        List<Contact> contacts = logic.listContacts();
        for (Contact contact : contacts) {
            System.out.println(contact);
        }
    }
}*/
